using System;
using System.Collections.Generic;
using UnityEngine;

public class ActivateObjectForCurrentGameType : MonoBehaviour
{
	[Serializable]
	public struct ObjectForTypeGame
	{
		public GameObject[] arrayActivateObject;

		public TypeGame typeGame;
	}

	[SerializeField]
	private List<ObjectForTypeGame> _listActivateObject = new List<ObjectForTypeGame>();

	private void Awake()
	{
		foreach (ObjectForTypeGame item in _listActivateObject)
		{
			GameObject[] arrayActivateObject = item.arrayActivateObject;
			foreach (GameObject gameObject in arrayActivateObject)
			{
				switch (item.typeGame)
				{
				case TypeGame.Offline:
					gameObject.SetActive(settings.offlineMode);
					break;
				case TypeGame.normal:
					gameObject.SetActive(!settings.offlineMode && GameController.instance.curTypeGame == TypeGame.normal);
					break;
				default:
					gameObject.SetActive(item.typeGame == GameController.instance.curTypeGame);
					break;
				}
			}
		}
	}
}
